package com.neusoft.lohas.modules.ivm.enums.workflow;

public enum WorkFlowTypeEnum {

	READY_FOR_DELIVERY(1, "订单派送流程", 1);

	private int type;
	private String desc;
	private int dbType;

	private WorkFlowTypeEnum(int type, String desc, int dbType) {
		this.type = type;
		this.desc = desc;
		this.dbType = dbType;
	}

	public static WorkFlowTypeEnum getEnumByStatus(int type, String... params) {
		WorkFlowTypeEnum[] enums = WorkFlowTypeEnum.values();
		for (WorkFlowTypeEnum item : enums) {
			if (item.getType() == type)
				return item;
		}
		return null;
	}
	
	public static String getEnumWorkFlowDescByType(int type) {
		WorkFlowTypeEnum[] enums = WorkFlowTypeEnum.values();
		for (WorkFlowTypeEnum item : enums) {
			if (item.getType() == type)
				return item.getDesc();
		}
		return null;
	}

	public static WorkFlowTypeEnum getEnumByDbStatus(int dbType, String... params) {
		WorkFlowTypeEnum[] enums = WorkFlowTypeEnum.values();
		for (WorkFlowTypeEnum item : enums) {
			if (item.getDbType() == dbType)
				return item;
		}
		return null;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public int getDbType() {
		return dbType;
	}

	public void setDbType(int dbType) {
		this.dbType = dbType;
	}
	
}
